package com.activitycode.datamodel.model;

import org.json.*;
import java.util.ArrayList;

public class ListInfoBase {
	
    private boolean result;
    private ArrayList<ListInfo> listInfo;
    
    
	public ListInfoBase () {
		
	}	
        
    public ListInfoBase (JSONObject json) {
    
        this.result = json.optBoolean("result");

        this.listInfo = new ArrayList<ListInfo>();
        JSONArray arrayListInfo = json.optJSONArray("list_info");
        if (null != arrayListInfo) {
            int listInfoLength = arrayListInfo.length();
            for (int i = 0; i < listInfoLength; i++) {
                JSONObject item = arrayListInfo.optJSONObject(i);
                if (null != item) {
                    this.listInfo.add(new ListInfo(item));
                }
            }
        }
        else {
            JSONObject item = json.optJSONObject("list_info");
            if (null != item) {
                this.listInfo.add(new ListInfo(item));
            }
        }


    }
    
    public boolean getResult() {
        return this.result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public ArrayList<ListInfo> getListInfo() {
        return this.listInfo;
    }

    public void setListInfo(ArrayList<ListInfo> listInfo) {
        this.listInfo = listInfo;
    }


    
}
